package com.zk.shop.servlet.order;

import com.zk.shop.entity.Order;
import com.zk.shop.entity.User;
import com.zk.shop.service.Impl.OrderServiceImpl;
import com.zk.shop.service.OrderService;
import com.zk.shop.util.JSONServlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @ClassName SelSellerOrderServlet
 * @Description TODO
 * @Author 李帅
 * @Date 2019/10/9 0009 上午 11:24
 * @Version 1.0
 **/
@WebServlet("SelSellerOrderServlet")
public class SelSellerOrderServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        HttpSession session=req.getSession();
        User user= (User) session.getAttribute("user");

        Order order=new Order(user);
        OrderService orderService=new OrderServiceImpl();
        List<Order> orderList=orderService.selSellerOrder(order);
        JSONServlet.getJson(req, resp, orderList);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req,resp);
    }
}
